package com.zxjbyte.yiyi.framework.common.core.ssl;

import javax.net.ssl.X509TrustManager;
import java.security.cert.CertificateException;

/**
 * Create a trust manager that does not validate certificate chains
 * @Author zhangxingjia
 * @Date 2023/4/19 17:07
 * @Version: 1.0
 */
public class DisableVerifyingSslTrustManager implements X509TrustManager {

    public static final X509TrustManager INSTANCE = new DisableVerifyingSslTrustManager();

    @Override
    public void checkClientTrusted(java.security.cert.X509Certificate[] x509Certificates, String authType) throws CertificateException {

    }

    @Override
    public void checkServerTrusted(java.security.cert.X509Certificate[] x509Certificates, String authType) throws CertificateException {

    }

    @Override
    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
        return new java.security.cert.X509Certificate[]{};
    }
}
